package com.cat.yygh.statistics.controller;

import com.cat.yygh.common.result.R;
import com.cat.yygh.statistics.service.StatisticsService;
import com.cat.yygh.vo.order.OrderCountQueryVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin/statistic")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;
    @ApiOperation(value = "获取订单统计数据")
    @GetMapping("/countByDate")
    public R statistics(@ApiParam(name = "orderCountQueryVo", value = "查询对象", required = false) OrderCountQueryVo orderCountQueryVo){
        Map<String,Object> map = statisticsService.statistics(orderCountQueryVo);
        return R.ok().data(map);
    }
}
